package com.kbt.listener;

import android.app.Activity;
import android.view.View;
import com.kbt.base.BaseApplication;
import com.kbt.util.data.StaticData;

import java.util.Map;

/**
 * @author zhgk
 * @package: com.kbt.listener
 * @TODO: 点击事件的时候，打开另一个Activity
 * @data: 2015/8/11 13:02
 * @version: V1.0
 */
public class ClickStartActivityListener implements View.OnClickListener {
    private Activity nowActivity;
    private Class target;
    private Map<String, Object> params;


    public ClickStartActivityListener(Activity activity, Class target, Map params) {
        this.nowActivity = activity;
        this.target = target;
        this.params = params;
    }

    @Override
    public void onClick(View v) {
//        Intent intent = new Intent(nowActivity, target);
//        Bundle bl = new Bundle();
//        //处理参数
//
//        for (Map.Entry<String, Object> entry : params.entrySet()) {
//            bl.putSerializable(entry.getKey(), (Serializable) entry.getValue());
//        }
//        intent.putExtra("bundle", bl);
//        nowActivity.startActivity(intent);
        BaseApplication.getInstance().currentItem=StaticData.INDEX_CAR;
        BaseApplication.getInstance().carStatus=StaticData.GOOD_CAR_COMPLETE;
        nowActivity.finish();

    }
}
